
/*自适应屏幕分辨率*/
(function() {
    var newRem = function() {
        var html = document.documentElement;
        html.style.fontSize = html.getBoundingClientRect().width /10+ 'px';
    };
    window.addEventListener('resize', newRem, false);
    newRem();
})();

/*获取url参数*/
function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if(r != null) {
		return unescape(r[2])
	}
	return null
}

/*底部跳转链接*/
mui('.mui-bar-tab').on('tap', 'a', function(e) {
	    var activeTab = mui(".mui-tab-item.mui-active")[0].getAttribute("href");
		var targetTab = this.getAttribute('href');
		if(targetTab == activeTab) {
			return;
		}
		window.location.href = targetTab;
});	
